package routers

import (
	"sale-admin/internal/app/web/controller"
	"sale-admin/internal/app/web/service/goods"

	"github.com/gin-gonic/gin"
)

func WebRouter(router *gin.RouterGroup) {
	router.POST("/shop/class/set", controller.GoodsClass{}.Set)       //设置商品分类
	router.POST("/shop/class/list", controller.GoodsClass{}.List)     //获取商品分类列表
	router.POST("/shop/class/remove", controller.GoodsClass{}.Remove) //删除商品分类

	// 新增商品角标
	router.POST("/shop/goods/corner_label/add", controller.Goods{}.AddCornerLabel)   //新增、编辑角标
	router.POST("/shop/goods/corner_label/del", controller.Goods{}.DelCornerLabel)   //删除角标
	router.POST("/shop/goods/corner_label/list", controller.Goods{}.ListCornerLabel) //角标列表
	router.POST("/shop/goods/corner_label/all", controller.Goods{}.AllCornerLabel)   //角标列表

	// 新增商品首页背景图
	router.POST("/shop/goods/background/add", controller.Goods{}.AddImgOfBackground)    // 新增背景图
	router.POST("/shop/goods/background/set", controller.Goods{}.SetImgOfBackground)    // 设置背景图
	router.POST("/shop/goods/background/del", controller.Goods{}.DelImgOfBackground)    // 删除背景图
	router.POST("/shop/goods/background/list", controller.Goods{}.ListImgOfBackground)  // 背景图列表
	router.POST("/shop/goods/background/bind-set", controller.Goods{}.BGBindSet)        // 绑定设置
	router.GET("/shop/goods/background/bind-setting", controller.Goods{}.BGBindSetting) // 获取绑定设置

	router.POST("/shop/goods/save", controller.Goods{}.SaveGoodsInfo) // 新增编辑商品信息
	router.POST("/shop/goods/add_goods_of_real",
		func(c *gin.Context) { c.Set("goods_type", goods.REAL_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 新增实物商品信息
	router.POST("/shop/goods/edit_goods_of_real",
		func(c *gin.Context) { c.Set("goods_type", goods.REAL_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 编辑实物商品信息
	router.POST("/shop/goods/add_goods_of_coupon",
		func(c *gin.Context) { c.Set("goods_type", goods.COUPON_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 新增优惠商品信息
	router.POST("/shop/goods/edit_goods_of_coupon",
		func(c *gin.Context) { c.Set("goods_type", goods.COUPON_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 编辑优惠商品信息
	router.POST("/shop/goods/add_goods_of_zero",
		func(c *gin.Context) { c.Set("goods_type", goods.ZERO_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 新增0元购商品信息
	router.POST("/shop/goods/edit_goods_of_zero",
		func(c *gin.Context) { c.Set("goods_type", goods.ZERO_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 编辑0元购商品信息
	router.POST("/shop/goods/add_goods_of_guide",
		func(c *gin.Context) { c.Set("goods_type", goods.GUIDE_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 新增导流商品信息
	router.POST("/shop/goods/edit_goods_of_guide",
		func(c *gin.Context) { c.Set("goods_type", goods.GUIDE_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 编辑导流商品信息
	router.POST("/shop/goods/add_goods_of_virtual",
		func(c *gin.Context) { c.Set("goods_type", goods.VIRTUAL_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 新增虚拟商品信息
	router.POST("/shop/goods/edit_goods_of_virtual",
		func(c *gin.Context) { c.Set("goods_type", goods.VIRTUAL_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 编辑虚拟商品信息
	router.POST("/shop/goods/add_goods_of_points",
		func(c *gin.Context) { c.Set("goods_type", goods.POINTS_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 新增积分商品信息
	router.POST("/shop/goods/edit_goods_of_points",
		func(c *gin.Context) { c.Set("goods_type", goods.POINTS_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 编辑积分商品信息
	router.POST("/shop/goods/add_goods_of_give",
		func(c *gin.Context) { c.Set("goods_type", goods.GIVE_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 新增活动赠品信息
	router.POST("/shop/goods/edit_goods_of_give",
		func(c *gin.Context) { c.Set("goods_type", goods.GIVE_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo) // 编辑活动赠品信息
	router.POST("/shop/goods/add-online-event",
		func(c *gin.Context) { c.Set("goods_type", goods.ONLINE_EVENT_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo,
	) // 新增线上活动商品
	router.POST("/shop/goods/update-online-event",
		func(c *gin.Context) { c.Set("goods_type", goods.ONLINE_EVENT_GOODS_TYPE) },
		controller.Goods{}.SaveGoodsInfo,
	)                                                                                                        // 更新线上活动商品
	router.POST("/shop/goods/goods_detail", controller.Goods{}.GoodsDetail)                                  // 获取商品详细信息
	router.POST("/shop/goods/list", controller.Goods{}.List)                                                 // 获取商品列表
	router.POST("/shop/goods/options", controller.Goods{}.Options)                                           // 获取商品列表
	router.POST("/shop/goods/remove", controller.Goods{}.Remove)                                             // 删除
	router.POST("/shop/goods/set", controller.Goods{}.Set)                                                   //【商品】上下架
	router.POST("/shop/goods/robot/off-shelf", controller.Goods{}.RobotGoodsOffShelf)                        // 机器商品下架
	router.POST("/shop/recommended-goods/robot/off-shelf", controller.Goods{}.RobotRecommendedGoodsOffShelf) // 机器推荐商品下架
	router.POST("/shop/goods-ad/robot/off-shelf", controller.Goods{}.RobotGoodsADOffShelf)                   // 机器商品广告下架
	router.POST("/shop/goods/add_goods_of_multi", controller.Goods{}.AddGoodsOfMulti)                        // 新建多规格商品
	router.POST("/shop/goods/edit_goods_of_multi", controller.Goods{}.EditGoodsOfMulti)                      // 编辑多规格商品
	router.POST("/shop/goods/del_goods_of_multi", controller.Goods{}.DelGoodsOfMulti)                        // 删除多规格商品
	router.POST("/shop/goods/detail_goods_of_multi", controller.Goods{}.DetailGoodsOfMulti)                  // 获取多规格商品详情

	router.POST("/shop/goods/set_activity_goods", controller.Goods{}.SetActivityGoods)   //新建、编辑活动商品
	router.POST("/shop/goods/del_activity_goods", controller.Goods{}.DelActivityGoods)   //删除
	router.POST("/shop/goods/get_activity_goods", controller.Goods{}.GetActivityGoods)   //查看活动详情
	router.POST("/shop/goods/activity_goods_list", controller.Goods{}.ActivityGoodsList) //活动列表
	router.POST("/shop/goods/sync_activity_goods", controller.Goods{}.SyncActivityGoods) //同步
	router.POST("/cert/confirm", controller.Payments{}.CertConfirm)

	router.GET("/shop/goods_log/log_list", controller.GoodsLogCtrl{}.List) //查询列表
	//router.POST("/shop/goods_log/log_detail", controller.GoodsLogCtrl{}.DelActivityGoods) //删除
}
